package com.demo.delete;

public class bb{
    public static void main(String[] args){

        int a,b,c;
        System.out.println("三位数中所有的水仙花数为：");
        for(int n = 100;n <= 999;n++){
            a = n /100; //获取百位数字
            b = n % 100 /10; //获取十位数字
            c = n %10; //获取个位数字
            if(a*a*a + b*b*b + c*c*c == n){
                System.out.println(n);
            }
        }
    }
}
